package org.progin.cloudfolder.msg;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public class ErrorPayload implements Payload {

	public static final byte INVALIDMSG = 0;
	public static final byte AUTHFAILED = 1;
	
	public byte errorId;
	
	public ErrorPayload() {}
	
	public ErrorPayload(byte errId) {
		errorId = errId;
	}
	
	@Override
	public byte getId() {
		return Payload.ERROR;
	}

	@Override
	public void write(DataOutputStream os) throws IOException {
		os.writeByte(errorId);
	}

	@Override
	public void read(DataInputStream is) throws IOException {
		errorId = is.readByte();
	}

}
